import { defineStore } from "pinia";

export const useGlobStore = defineStore("globStore", {
    state: () => ({
        // 定义全局变量

        //是否弹出登录界面
        isLogin: false,
        //是否弹出修改密码界面
        isUpdatePassword: false,
        //是否刷新
        isResh: false,
        //是否显示了承诺书（评委角色）
        isAgree: true,
        //当前评审的id
        reviewId: '',
        //评分列表
        tableData: [{itemId:0}],
        reviewIndex: 0
    }),
    getters: {
        // 定义全局计算属性
    },
    actions: {
        // 定义全局方法
        setIsLogin(data: any) {
            this.isLogin = data;
        },
        setIsUpdatePassword(data: any) {
            this.isUpdatePassword = data;
        },
        setIsResh(data: any) {
            this.isResh = data;
        },
        setIsAgree(data: any) {
            this.isAgree = data;
        },
        setReviewId(data: any) {
            this.reviewId = data;
        },
        setTableData(data: any) {
            this.tableData = data;
        },
        setReviewIndex(data: any) {
            this.reviewIndex = data;
        }
    },
    persist: {
        key: 'globStore',
        paths: ['staffData']
    }
})